package org.test.cloud.stream.rocketmq.util;

import org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

@Component
public class ExamplePartitionKeyExtraction implements PartitionKeyExtractorStrategy {
    public static final String PARTITION_PROP_KEY = "partition";

    @Override
    public Object extractKey(Message<?> message) {
        return message.getHeaders().get(PARTITION_PROP_KEY);
    }
}
